import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Ab01newVO, Ab01newForm, Ab01newQuery } from '@/api/yuanshidian/ab01new/types';

/**
 * 查询新单位信息列表
 * @param query
 * @returns {*}
 */

export const listAb01new = (query?: Ab01newQuery): AxiosPromise<Ab01newVO[]> => {
  return request({
    url: '/yuanshidian/ab01new/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询新单位信息详细
 * @param ID
 */
export const getAb01new = (ID: string | number): AxiosPromise<Ab01newVO> => {
  return request({
    url: '/yuanshidian/ab01new/' + ID,
    method: 'get'
  });
};

/**
 * 新增新单位信息
 * @param data
 */
export const addAb01new = (data: Ab01newForm) => {
  return request({
    url: '/yuanshidian/ab01new',
    method: 'post',
    data: data
  });
};

/**
 * 修改新单位信息
 * @param data
 */
export const updateAb01new = (data: Ab01newForm) => {
  return request({
    url: '/yuanshidian/ab01new',
    method: 'put',
    data: data
  });
};

/**
 * 删除新单位信息
 * @param ID
 */
export const delAb01new = (ID: string | number | Array<string | number>) => {
  return request({
    url: '/yuanshidian/ab01new/' + ID,
    method: 'delete'
  });
};
